<?php
!function_exists('adminmsg') && die('Forbidden');

if(!$step){
	ifcheck($very['aggreblog'],'aggreblog');
}elseif($step==2){
	if($config['aggreblog']){
		!eregi('^http://',$config['blog_url']) && Showmsg('mod_invalidurl');
		empty($config['blog_dbname']) && Showmsg('mod_nodbname');
		if(mysql_connect($config['blog_dbhost'],$config['blog_dbuser'],$config['blog_dbpw'])){
		
		}else{
			Showmsg('mod_invaliddb');
		}
		mysql_close();
	}
	foreach ($config as $key=>$value){
		$key = 'db_'.$key;
		$value = addslashes($value);
		$db->pw_update(
			"SELECT * FROM cms_config WHERE db_name='$key'",
			"UPDATE cms_config SET db_value='$value' WHERE db_name='$key'",
			"INSERT INTO cms_config (db_name,db_value) VALUES('$key','$value')"
		);
	}
	
	require_once(R_P.'require/class_cache.php');
	$cache = new Cache();
	$cache->config();
	adminmsg('operate_success');
}
require PrintEot('header');
require PrintEot('mod_blog');
adminbottom();
?>